package com.shujia.java.day8.demo3;

public class Bird extends Animals {
    private String sex;//性别
    public Bird() {
    }
    public Bird(String name, int age, String color, String sex) {
        super(name, age, color);
        this.sex = sex;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public void play(){
        System.out.println("鸟在飞");
    }
    @Override
    public void eat() {
        System.out.println("这是一只"+sex+"的"+super.getName()+"在吃饭");
    }
}
